function renderTime(date) {
  var da = new Date(parseInt(date.replace("/Date(", "").replace(")/", "").split("+")[0]));
  var Year = da.getFullYear(); //ie火狐下都可以
  var Month = da.getMonth() + 1;
  var Day = da.getDate();
  var Hours = da.getHours();
  var Minutes = da.getMinutes();
  var Seconds = da.getSeconds();
  var CurrentDate = "";
  CurrentDate += Year + "-";
  if (Month >= 10) {
    CurrentDate += Month + "-";
  }
  else {
    CurrentDate += "0" + Month + "-";
  }
  if (Day >= 10) {
    CurrentDate += Day;
  }
  else {
    CurrentDate += "0" + Day;
  }
  if (Hours < 10) {
    Hours = "0" + Hours;
  }
  if (Minutes < 10) {
    Minutes = "0" + Minutes;
  }
  if (Seconds < 10) {
    Seconds = "0" + Seconds;
  }
  return CurrentDate + " " + Hours + ":" + Minutes + ":" + Seconds;
}
function formatTime(date) {
   var year = date.getFullYear()
   var month = date.getMonth() + 1
   var day = date.getDate()

   var hour = date.getHours()
   var minute = date.getMinutes()
   var second = date.getSeconds()

   return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
function showToast(msg, isback) {
  if (msg) {
    wx.showModal({
      title: '提示',
      content: msg,
      showCancel: false,
      confirmColor: '#ff0000',
      confirmText: '知道了',
      complete: function (res) {
        if (isback) {
          wx.navigateBack()
        }
      }
    })
  }
}
module.exports = {
  renderTime: renderTime,
  formatData:formatTime,
  showToast: showToast
}